<?php

namespace App\Http\Controllers;

use App\Models\Blog;

class BlogController extends Controller
{
    public function index()
    {
        $Blogs = Blog::query()->latest()->take(3)->get();
        return view("homepage", ['blogs' => $Blogs]);
    }

    public function show($id) {
        $Blog = Blog::query()->find($id);
        return view("blogs.show", ['blog' => $Blog]);
    }
}
